﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acaweb.Data.Contracts.Base
{
    /// <summary>
    /// Role interface for DAOs that support saves and updates to entities.
    /// </summary>
    /// <typeparam name="TEntity">Entity type.</typeparam>
    /// <typeparam name="TId">Entity Id type.</typeparam>
    public interface ISupportsSave<T>
    {
        /// <summary>
        /// Saves the given entity.
        /// </summary>
        /// <param name="entity">Entity to save.</param>
        /// <returns>The Id for saved entity.</returns>
        void Save(T obj);

        /// <summary>
        /// Saves or updates the entity. Behavior depends on the current state of entity's ID.
        /// </summary>
        /// <param name="entity">Entity to save or update.</param>
        //void Update(T obj);
    }
}
